static Object* Runtime_JsonAstParse(Arguments args) {
  HandleScope scope;
  ASSERT(args.length() == 1);
  CONVERT_ARG_CHECKED(String, source, 0);
  
  // Create a script object describing the script to be compiled.
  Handle<Script> script = Factory::NewScript(source);
  // TODO: Set the script name - but is this the most efficient/correct way?
  script->set_name(*Factory::NewStringFromAscii(CStrVector("JSON.AST.parse()")));
  /* TODO: how should the syntax error line number error be reported?
    if (!script_name.is_null()) {
      script->set_name(*script_name);
      script->set_line_offset(Smi::FromInt(line_offset));
      script->set_column_offset(Smi::FromInt(column_offset));
    }
  */
  
  // Build AST.
  CompilationZoneScope zone_scope(DELETE_ON_EXIT);
  FunctionLiteral* flit = MakeAST(false, script, NULL, NULL);
  
  // Check for Errors
  if (flit == NULL) {
    ASSERT(Top::has_pending_exception());
    return Failure::Exception();
  }

  // DEBUG: Uncomment next line to print the pretty AST to double check
  // PrintF("--- The AST ---\n%s\n", AstPrinter().PrintProgram(flit));
  
  //JsonAstBuilder2 jab = JsonAstBuilder2();
  //Handle<String> result = Factory::NewStringFromAscii(CStrVector(jab.BuildProgram(flit)));
  
  Handle<String> result = Factory::NewStringFromAscii(CStrVector(JsonAstBuilder2().BuildProgram(flit)));

  return *result;
}


